package http

import (
	"fmt"
	"log"
	"net/http"
	"os"
	"probeping/src/store"
)

func StartHttp() {
	configApiRoutes()
	configIndexRoutes()
	log.Println("[func:StartHttp] starting to listen on ", store.Cfg.Port)
	s := fmt.Sprintf(":%d", store.Cfg.Port)
	err := http.ListenAndServe(s, nil)
	if err != nil {
		log.Fatalln("[StartHttp]", err)
	}
	os.Exit(0)
}
